package com.runshu.newsmartark.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.runshu.newsmartark.R;
import com.runshu.newsmartark.entity.CategoryListEntity;

import java.util.List;

/**
 * Demo class
 *
 * @author yu
 * @date 2020/11/2
 * @decs：
 */

public class ProTypeAdapter extends BaseQuickAdapter<CategoryListEntity, BaseViewHolder> {
    public ProTypeAdapter( @Nullable List<CategoryListEntity> data) {
        super(R.layout.item_pro_type, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CategoryListEntity item) {
        helper.setText(R.id.tv_type,item.getLabel());
        if (item.isCheck()){
            helper.setBackgroundRes(R.id.tv_type,R.mipmap.icon_select_type);
        }else {
            helper.setBackgroundRes(R.id.tv_type,0);
        }
    }
}